package meituan;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/8/13
 * @project AutumnOffer
 * @description
 **/
public class Distrubute {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        int[] t = new int[m];
        for(int i=0;i<m;i++){
            t[i] = scanner.nextInt();
        }
        int[] res = new int[m];
        for(int i=1;i<m;i++){
            res[i] = Integer.MAX_VALUE;

        }
        int path=n*2;
        for(int i=1;i<m;i++){
            if(path<=t[i]||t[i]-t[i-1]>=n&&i>1){
                res[i] = res[i-1];
            }else {
                res[i] = Math.min(res[i-1]+1,res[i]);
            }
        }
        System.out.println(res[m-1]);
    }
}
